package ysc.cqnu.operdb.serviceImpl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import ysc.cqnu.operdb.entity.ReceiveUserInfo;
import ysc.cqnu.operdb.entity.ResultData;
import ysc.cqnu.operdb.entity.User;
import ysc.cqnu.operdb.mapper.UserMapper;
import ysc.cqnu.operdb.service.UserEmileCheckService;

@Component
public class UserEmileCheckServiceImpl implements UserEmileCheckService {
    @Autowired
    private User user;
    @Autowired
    private UserMapper userMapper;
    @Autowired
    private ResultData resultData;
    @Override
    public ResultData emileCheck(ReceiveUserInfo receiveLogin) {
        user = userMapper.checkByNameAndEmile(receiveLogin);
        if (user == null) {
            resultData.flag = "noName";
            resultData.data = null;
            return resultData;
        }
        resultData.flag = "checksuccess";
        resultData.data = null;
        return resultData;
    }
}
